package com.wjs.spring.service;

import com.wjs.spring.dao.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class TeacherService {
    private Teacher teacher;

    @Autowired
    @Qualifier("teacherImpl2")
    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public void service(){
        teacher.teach();
    }
}
